package com.ss.test11;

import java.util.Comparator;
import java.util.Map;
import java.util.TreeMap;

/**
 * @Auther: 520ljs
 * @Date: 2022/3/17 - 03 - 17 - 21:51
 */
public class Test04 {
    //这是一个main方法，是程序的入口
    public static void main(String[] args) {
        Map<Student02,Integer> map = new TreeMap<>(new Comparator<Student02>() {
            @Override
            public int compare(Student02 o1, Student02 o2) {
                return ((Double)(o1.getHeight())).compareTo((Double)(o2.getHeight()));
            }
        });
        map.put(new Student02(19,"alili",170.5),1001);
        map.put(new Student02(19,"blili",160.5),1452);
        map.put(new Student02(19,"clili",167.5),1631);
        map.put(new Student02(19,"dlili",163.5),1184);
        map.put(new Student02(19,"blili",169.5),1025);
        System.out.println(map.size());
        System.out.println(map);
    }
}
